<template>
  <div class="daily">
    <!-- 搜索栏 -->
    <searchBar :activeIndex="props.activeIndex" @changeNav="changeNav"></searchBar>
    <!-- 列表栏 -->
    <onDutyTable @showTemplate="showTemplate"></onDutyTable>
    <!-- 排班模板 -->
    <templateDialog :dialogVisible="dialogVisible" @closeDialog="closeDialog"></templateDialog>
  </div>
</template>

<script setup lang="ts">
import searchBar from "./searchBar.vue";
import onDutyTable from "./table.vue";
import templateDialog from "./templateDialog.vue";

const props = defineProps({
  activeIndex: {
    type: Number,
    default: 0
  }
})

let emit = defineEmits(['changeNav'])

const changeNav = (index: number) => {
  emit('changeNav', index)
}

let dialogVisible = ref(false);//是否打开弹窗

//关闭弹窗
const closeDialog = () => {
  dialogVisible.value = false;
}

//打开弹窗
const showTemplate = () => {
  console.log('39');
  
  dialogVisible.value = true;
}
</script>

<style lang="scss" scoped>
.daily {
  height: 100%;
  min-height: 0;
}
</style>